package com.ly.heart.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ly.common.core.domain.BaseVo;
import lombok.Data;
import com.ly.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 金蝶-发票-应收单/销售开票对象 erp_king_invoice_receivable_info
 * @author wutao
 * @date 2024-06-26
 */
@TableName ("erp_king_invoice_receivable_info")
@ApiModel (value = "erp_king_invoice_receivable_info对象", description = "金蝶-发票-应收单/销售开票")
@Data
public class KingInvoiceReceivableEntity extends BaseVo {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId (value = "id", type = IdType.INPUT)
    private String id;

    /**
     *
     */
    @ApiModelProperty ("父单据，冲红的时候使用该字段")
    @TableField ("parent_id")
    @Excel (name = "父单据")
    private String parentId;

    /**
     * 单据类型,接口
     */
    @ApiModelProperty ("源单类型：\n" +
            "1、手动创建\n" +
            "2、销售订单\n" +
            "3、销售出库单\n" +
            "4、销售退货单\n" +
            "5、冲红")
    @TableField ("source_doc_type")
    @Excel (name = "源单类型")
    private Integer sourceDocType;

    /**
     * 单据类型,接口
     */
    @ApiModelProperty ("单据类型编码,接口")
    @TableField ("doc_type_code")
    @Excel (name = "单据类型,接口")
    private String docTypeCode;

    @ApiModelProperty ("是否提前开票，默认为0 false")
    @TableField ("is_before")
    @Excel (name = "是否提前开票")
    private Boolean isBefore;

    /**
     * 客户id，接口
     */
    @ApiModelProperty ("客户id，接口")
    @TableField ("customer_id")
    @Excel (name = "客户id，接口")
    private String customerId;

    /**
     * 销售员,员工接口
     */
    @ApiModelProperty ("销售员,员工接口")
    @TableField ("sale_user_id")
    @Excel (name = "销售员,员工接口")
    private String saleUserId;

    /**
     * 立账类型;1:业务应收
     */
    @ApiModelProperty ("立账类型;1:业务应收")
    @TableField ("account_type")
    @Excel (name = "立账类型;1:业务应收")
    private Integer accountType;

    /**
     * 单据编号
     */
    @ApiModelProperty ("单据编号")
    @TableField ("doc_no")
    @Excel (name = "单据编号")
    private String docNo;

    /**
     * 币别，接口
     */
    @ApiModelProperty ("币别，接口")
    @TableField ("base_currency_id")
    @Excel (name = "币别，接口")
    private String baseCurrencyId;

    /**
     * 结算组织Id,接口
     */
    @ApiModelProperty ("结算组织Id,接口")
    @TableField ("settlement_dept_id")
    @Excel (name = "结算组织Id,接口")
    private String settlementDeptId;

    /**
     * 业务时间
     */
    @ApiModelProperty ("业务时间")
    @TableField ("biz_time")
    @JsonFormat (pattern = "yyyy-MM-dd")
    @Excel (name = "业务时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date bizTime;

    /**
     * 价税合计=明细的价税合计
     */
    @ApiModelProperty ("价税合计=明细的价税合计")
    @TableField ("total_tax_amount")
    @Excel (name = "价税合计=明细的价税合计")
    private String totalTaxAmount;

    @ApiModelProperty ("不含税金额")
    @TableField ("not_tax_amount")
    @Excel (name = "不含税金额")
    private String notTaxAmount;

    @ApiModelProperty ("税额")
    @TableField ("rate_amount")
    @Excel (name = "税额")
    private String rateAmount;

    @ApiModelProperty ("汇率")
    @TableField ("rate")
    @Excel (name = "汇率")
    private String rate;

    @ApiModelProperty ("价税合计本位币")
    @TableField ("total_tax_price_currency")
    @Excel (name = "价税合计本位币")
    private String totalTaxPriceCurrency;

    @ApiModelProperty ("税额本位币")
    @TableField ("rate_amount_currency")
    @Excel (name = "价税合计本位币")
    private String rateAmountCurrency;

    @ApiModelProperty ("不含税金额本位币")
    @TableField ("not_tax_amount_currency")
    @Excel (name = "价税合计本位币")
    private String notTaxAmountCurrency;

    /**
     * 收款组织,当前登录公司
     */
    @ApiModelProperty ("收款组织,当前登录公司")
    @TableField ("receipt_dept_id")
    @Excel (name = "收款组织,当前登录公司")
    private String receiptDeptId;

    /**
     * 到期日
     */
    @ApiModelProperty ("到期日")
    @TableField ("due_time")
    @JsonFormat (pattern = "yyyy-MM-dd")
    @Excel (name = "到期日", width = 30, dateFormat = "yyyy-MM-dd")
    private Date dueTime;

    /**
     * 收款条件id，走接口
     */
    @ApiModelProperty ("收款条件id，走接口")
    @TableField ("receipt_condition_id")
    @Excel (name = "收款条件id，走接口")
    private String receiptConditionId;

    /**
     * 销售组织，当前登录公司
     */
    @ApiModelProperty ("销售组织，当前登录公司")
    @TableField ("sale_company_id")
    @Excel (name = "销售组织，当前登录公司")
    private String saleCompanyId;

    /**
     * 单据状态;1:暂存;2:提交;3:审核
     */
    @ApiModelProperty ("单据状态;金蝶数据统一单据数据状态；\n" +
            "Z：暂存\n" +
            "A：创建\n" +
            "B：审核中\n" +
            "C：已审核\n" +
            "D：重新审核\n" +
            "E：已冲红;前端不处理该字段")
    @TableField ("status")
    @Excel (name = "单据状态")
    private String status;

    /**
     * 销售部门，接口
     */
    @ApiModelProperty ("销售部门，接口")
    @TableField ("sale_dept_id")
    @Excel (name = "销售部门，接口")
    private String saleDeptId;

    /**
     * 整单折扣金额=明细的折扣金额
     */
    @ApiModelProperty ("整单折扣金额=明细的折扣金额")
    @TableField ("discount_amount")
    @Excel (name = "整单折扣金额=明细的折扣金额")
    private String discountAmount;

    /**
     * 按费用项目生成计划;1:是;2:否
     */
    @ApiModelProperty ("按费用项目生成计划;1:是;2:否")
    @TableField ("is_fee")
    @Excel (name = "按费用项目生成计划;1:是;2:否")
    private Boolean isFee;

    /**
     * 价外税;1:是;2:否
     */
    @ApiModelProperty ("价外税;1:是;2:否")
    @TableField ("is_extra_price_tax")
    @Excel (name = "价外税;1:是;2:否")
    private Boolean isExtraPriceTax;

    /**
     * 按含税单价录入;1:是;2:否
     */
    @ApiModelProperty ("按含税单价录入;1:是;2:否")
    @TableField ("is_include_tax_price")
    @Excel (name = "按含税单价录入;1:是;2:否")
    private Boolean isIncludeTaxPrice;

    /**
     * 订货方,客户接口
     */
    @ApiModelProperty ("订货方,客户接口")
    @TableField ("order_customer_id")
    @Excel (name = "订货方,客户接口")
    private String orderCustomerId;

    /**
     * 收货方,客户接口
     */
    @ApiModelProperty ("收货方,客户接口")
    @TableField ("receiving_customer_id")
    @Excel (name = "收货方,客户接口")
    private String receivingCustomerId;

    /**
     * 付款方,客户接口
     */
    @ApiModelProperty ("付款方,客户接口")
    @TableField ("pay_customer_id")
    @Excel (name = "付款方,客户接口")
    private String payCustomerId;

    /**
     * 结算方式id,结算方式接口
     */
    @ApiModelProperty ("结算方式id,结算方式接口")
    @TableField ("settlement_type_id")
    @Excel (name = "结算方式id,结算方式接口")
    private String settlementTypeId;

    /**
     *
     */
    @ApiModelProperty ("到期日计算日期")
    @TableField ("due_cal_date")
    @JsonFormat (pattern = "yyyy-MM-dd")
    @Excel (name = "到期日计算日期")
    private Date dueCalDate;

    /**
     * 本币别，接口
     */
    @ApiModelProperty ("本币别，接口")
    @TableField ("own_base_currency_id")
    @Excel (name = "本币别，接口")
    private String ownBaseCurrencyId;

    /**
     * 备注
     */
    @ApiModelProperty ("备注")
    @TableField ("remarks")
    @Excel (name = "备注")
    private String remarks;

    @ApiModelProperty ("流程状态")
    @TableField ("state")
    private String state;

    @ApiModelProperty ("创建人")
    @TableField ("create_user_id")
    private String createUserId;

    @ApiModelProperty ("创建时间")
    @TableField ("create_date")
    @JsonFormat (pattern = "yyyy-MM-dd: HH:ss:mm")
    private Date createDate;

    @ApiModelProperty ("更新人")
    @TableField ("update_user_id")
    private String updateUserId;

    @ApiModelProperty ("更新时间")
    @TableField ("update_date")
    private Date updateDate;

    /**
     * 是否可用
     */
    @ApiModelProperty ("是否已推金蝶")
    @TableField ("is_send")
    @Excel (name = "是否已推金蝶")
    private Integer isSend;

    /**
     * 是否可用
     */
    @ApiModelProperty ("是否可用")
    @TableField ("is_used")
    @Excel (name = "是否可用")
    private Integer isUsed;

    @ApiModelProperty ("业务type")
    @TableField (exist = false)
    private String businessType;

    @ApiModelProperty ("流程模型id")
    @TableField (exist = false)
    private String modelId;

    @ApiModelProperty ("流程实例id")
    @TableField ("instance_id")
    private String instanceId;

    @ApiModelProperty ("客户名称")
    @TableField (exist = false)
    private String customerName;

    @ApiModelProperty ("销售员")
    @TableField (exist = false)
    private String saleUserName;

    @ApiModelProperty ("结算组织")
    @TableField (exist = false)
    private String settlementDeptName;

    @ApiModelProperty ("收款组织")
    @TableField (exist = false)
    private String receiptDeptName;

    @ApiModelProperty ("销售组织")
    @TableField (exist = false)
    private String saleCompanyName;

    @ApiModelProperty ("销售部门名称")
    @TableField (exist = false)
    private String saleDeptName;

    @ApiModelProperty ("币别名称")
    @TableField (exist = false)
    private String currencyName;

    @ApiModelProperty ("结算方式")
    @TableField (exist = false)
    private String settlementTypeName;

    @ApiModelProperty ("客户编码")
    @TableField (exist = false)
    private String customerCode;

    @ApiModelProperty ("销售员编码")
    @TableField (exist = false)
    private String saleUserCode;

    @ApiModelProperty ("币别编码")
    @TableField (exist = false)
    private String currencyCode;

    @ApiModelProperty ("收款条件编码")
    @TableField (exist = false)
    private String conditionCode;

    @ApiModelProperty ("收款条件名称")
    @TableField (exist = false)
    private String receiptConditionName;

    @ApiModelProperty ("销售部门编码")
    @TableField (exist = false)
    private String saleDeptCode;

    @ApiModelProperty ("订货方编码")
    @TableField (exist = false)
    private String orCustomerCode;

    @ApiModelProperty ("订货方名称")
    @TableField (exist = false)
    private String orderCustomerName;

    @ApiModelProperty ("收货方编码")
    @TableField (exist = false)
    private String trCustomerCode;

    @ApiModelProperty ("收货方名称")
    @TableField (exist = false)
    private String receivingCustomerName;

    @ApiModelProperty ("付款方编码")
    @TableField (exist = false)
    private String chCustomerCode;

    @ApiModelProperty ("付款方名称")
    @TableField (exist = false)
    private String payCustomerName;

    @ApiModelProperty ("结算方式编码")
    @TableField (exist = false)
    private String settlementCode;

    @ApiModelProperty ("物料编码")
    @TableField (exist = false)
    private String materialCode;

    @ApiModelProperty ("物料名称")
    @TableField (exist = false)
    private String materialName;

    @ApiModelProperty ("付款核销状态")
    @TableField (exist = false)
    private String verifyStatus;

    @ApiModelProperty ("明细行Id")
    @TableField (exist = false)
    private String receiptDetailId;

    @ApiModelProperty ("明细行源单类型")
    @TableField (exist = false)
    private String detailSourceDocType;

    @ApiModelProperty ("明细行源单Id，选单时带来的")
    @TableField (exist = false)
    private String detailSourceId;

    @ApiModelProperty ("明细行源单的明细Id")
    @TableField (exist = false)
    private String sourceMaterialDetailId;

    @ApiModelProperty ("明细行数量")
    @TableField (exist = false)
    private String detailNum;

    @ApiModelProperty ("明细行不含税金额")
    @TableField (exist = false)
    private String detailNotTaxAmount;

    @ApiModelProperty ("明细行折扣额")
    @TableField (exist = false)
    private String detailDiscountAmount;

    @ApiModelProperty ("明细行价税合计")
    @TableField (exist = false)
    private String detailTotalTaxPrice;

    @ApiModelProperty ("明细行税额")
    @TableField (exist = false)
    private String detailRateAmount;

    @ApiModelProperty ("明细行税额本位币")
    @TableField (exist = false)
    private String detailRateAmountCurrency;

    @ApiModelProperty ("明细行价税合计本位币")
    @TableField (exist = false)
    private String detailTotalTaxPriceCurrency;

    @ApiModelProperty ("明细行金额本位币")
    @TableField (exist = false)
    private String detailNotTaxAmountCurrency;

    @ApiModelProperty ("明细行出库单编码")
    @TableField (exist = false)
    private String detailInventoryCode;

    @ApiModelProperty ("创建人姓名")
    @TableField (exist = false)
    private String createName;

    @ApiModelProperty ("单据类型")
    @TableField (exist = false)
    private String docTypeName;

    @ApiModelProperty ("源单单号")
    @TableField (exist = false)
    private String sourceDocNo;

    @ApiModelProperty ("销售订单号")
    @TableField (exist = false)
    private String detailSaleOrderCode;

    @ApiModelProperty ("销售订单行号")
    @TableField (exist = false)
    private String detailSaleLineNumber;


    /******************************************************************
     * 以下为计算属性
     */
    @ApiModelProperty ("对应源单金额")
    @TableField (exist = false)
    private String sourceAmount = "0";

    @ApiModelProperty ("成本差异金额")
    @TableField (exist = false)
    private String costDifferenceAmount = "0";

    @ApiModelProperty ("对应源单价税合计")
    @TableField (exist = false)
    private String sourceTaxPriceAmount = "0";

    @ApiModelProperty ("价税合计差异额")
    @TableField (exist = false)
    private String taxPriceAmountDiff = "0";

    @ApiModelProperty ("对应源单汇率")
    @TableField (exist = false)
    private String sourceRate = "0";

    @ApiModelProperty ("成本汇率差异金额")
    @TableField (exist = false)
    private String rateDiff = "0";

    @ApiModelProperty ("价税合计汇率差异金额")
    @TableField (exist = false)
    private String taxPriceAmountRateDiff = "0";

}
